package com.chhuang.system.po;

import java.io.Serializable;
import com.chhuang.core.model.AbstractPersistentModel;
import com.chhuang.core.validation.ValidGroupSave;
import com.chhuang.core.validation.ValidGroupUpdate;
import com.sun.xml.bind.CycleRecoverable;
import org.springframework.format.annotation.DateTimeFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.*;

/**
* ChMenu Model
* @author ChHuang
* @date Thu Mar 09 09:01:29 CST 2017
*/
public class ChMenu extends AbstractPersistentModel implements CycleRecoverable{
	private static final long serialVersionUID = 713065966926634413L;
	@NotNull(message="{ChMenu.menuId.NotNull}",groups={ValidGroupUpdate.class})
	@Size(max=32,message="{ChMenu.menuId.Size}",groups={ValidGroupSave.class})
	private String menuId;
	public String getMenuId(){
		return menuId;
	}
	public void setMenuId(String menuId){
		this.menuId=menuId;
	}
	@Size(max=32,message="{ChMenu.menuName.Size}",groups={ValidGroupSave.class})
	private String menuName;
	public String getMenuName(){
		return menuName;
	}
	public void setMenuName(String menuName){
		this.menuName=menuName;
	}
	private Boolean asParent;
	public Boolean getAsParent(){
		return asParent;
	}
	public void setAsParent(Boolean asParent){
		this.asParent=asParent;
	}
	@Size(max=32,message="{ChMenu.parentId.Size}",groups={ValidGroupSave.class})
	private String parentId;
	public String getParentId(){
		return parentId;
	}
	public void setParentId(String parentId){
		this.parentId=parentId;
	}
	@Size(max=128,message="{ChMenu.url.Size}",groups={ValidGroupSave.class})
	private String url;
	public String getUrl(){
		return url;
	}
	public void setUrl(String url){
		this.url=url;
	}
	@Size(max=32,message="{ChMenu.icon.Size}",groups={ValidGroupSave.class})
	private String icon;
	public String getIcon(){
		return icon;
	}
	public void setIcon(String icon){
		this.icon=icon;
	}
	private Integer menuOrder;
	public Integer getMenuOrder(){
		return menuOrder;
	}
	public void setMenuOrder(Integer menuOrder){
		this.menuOrder=menuOrder;
	}
	@Override
	public Serializable getId() {
		return getMenuId();
	}
	@Override
	public void setId(Serializable id) {
		setMenuId((String)id);
	}
	@Override
	public Object onCycleDetected(Context arg0) {
		ChMenu temp=new ChMenu();
		temp.setMenuId(menuId);
		return temp;
	}
	@Override
	public String toString() {
		return "ChMenu [menuId="+menuId+",menuName="+menuName+",asParent="+asParent+",parentId="+parentId+",url="+url+",icon="+icon+",menuOrder="+menuOrder+"]";
	}
}